home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Mania 4
/
MacMania 4.toast
/
/
Demo's
/
Igor Demo Pro
/
1 PutContentsIn Igor Pro Folder
/
WaveMetrics Procedures
/
Annotations
/
Remove Tags
< prev
Wrap
Text File
|
1996-02-28
|
1KB
|
64 lines
#include <AnnotationInfo Procs>
#include <Keyword-Value>
| Remove Tags
#pragma rtGlobals=1
Menu "Graph"
"-"
"Remove Tags..."
End
Proc RemoveTags(which)
Variable which=1
Prompt which,"Remove which tags?",popup,"all tags;all tags attached off-screen"
Silent 1;PauseUpdate
String ann,axis,wv,info,str=AnnotationList("")
Variable offset1, offset2,len,del,instance,hash
offset1 = 0
do
offset2 = StrSearch(str, ";" , offset1)
if (offset2 == -1)
break;
endif
ann= str[offset1, offset2-1]
info=AnnotationInfo("",ann)
if( CmpStr(AnnotationType(info),"Tag")==0 )
del=1
if(which == 2) | delete only off-screen tags
del=TagIsOffScreen(info)
endif
if( del )
Tag/K/N=$ann
endif
endif
offset1 = offset2+1
while (1)
End
Function TagIsOffScreen(info)
String info
String axis,wv,tinfo
Variable instance,hash,offscreen
Variable/D xAttach= AnnotationAttachX(info)
wv= AnnotationYWave(info) | wave tag is attached to
hash=strsearch(wv,"#",0)
if(hash != -1 )
instance=str2num(wv[hash+1,99])
wv[hash,99]=""
endif
tinfo=TraceInfo("",wv,instance)
axis=StrByKey("XAXIS",tinfo) | X axis wave is graphed against
GetAxis/Q $axis
if( V_Min > V_Max ) | V_Min and V_Max are actually left and right values
Variable/D tmp=V_Max
V_Max= V_Min
V_Min= tmp
endif
offscreen= xAttach != limit(xAttach,V_Min,V_Max)
return offscreen
End